#ifndef THREADMANFORUSER_H
#define THREADMANFORUSER_H

#include "../hle.h"

void sceKernelCreateCallback();
void sceKernelCheckCallback();
void sceKernelDeleteCallback();
void sceKernelNotifyCallback();
void _sceKernelReturnFromCallback();

void sceKernelCreateMutex();
void sceKernelDeleteMutex();
void sceKernelLockMutex();
void sceKernelLockMutexCB();
void sceKernelUnlockMutex();

void sceKernelCreateLwMutex();
void sceKernelDeleteLwMutex();

void sceKernelSleepThread(); 
void sceKernelSleepThreadCB(); 
void sceKernelWakeupThread();
void sceKernelSuspendThread();
void sceKernelResumeThread();
void sceKernelWaitThreadEnd();
void sceKernelDelayThread();
void sceKernelDelayThreadCB();

void sceKernelCancelSema();
void sceKernelCreateSema();
void sceKernelDeleteSema();
void sceKernelPollSema();
void sceKernelReferSemaStatus();
void sceKernelSignalSema();
void sceKernelWaitSema();
void sceKernelWaitSemaCB();

void sceKernelCreateEventFlag();
void sceKernelClearEventFlag();
void sceKernelDeleteEventFlag();
void sceKernelSetEventFlag();
void sceKernelWaitEventFlag();
void sceKernelWaitEventFlagCB();
void sceKernelPollEventFlag();
void sceKernelCancelEventFlag();
void sceKernelReferEventFlagStatus();

void sceKernelCreateVpl();
void sceKernelDeleteVpl();
void sceKernelAllocateVpl();
void sceKernelAllocateVplCB();
void sceKernelTryAllocateVpl();
void sceKernelFreeVpl();
void sceKernelCancelVpl();
void sceKernelReferVplStatus();

void sceKernelCreateFpl();
void sceKernelDeleteFpl();
void sceKernelAllocateFpl();
void sceKernelAllocateFplCB();
void sceKernelTryAllocateFpl();
void sceKernelFreeFpl();
void sceKernelCancelFpl();
void sceKernelReferFplStatus();

void _sceKernelReturnFromTimerHandler();
void sceKernelUSec2SysClock();
void sceKernelUSec2SysClockWide();
void sceKernelSysClock2USec();
void sceKernelSysClock2USecWide();
void sceKernelGetSystemTime();
void sceKernelGetSystemTimeWide();
void sceKernelGetSystemTimeLow();

void sceKernelCreateVTimer();
void sceKernelStartVTimer();
void sceKernelSetVTimerHandler();

void sceKernelGetThreadExitStatus();
void sceKernelCreateThread();
void sceKernelDeleteThread();
void sceKernelStartThread();
void _sceKernelExitThread();
void sceKernelExitThread();
void sceKernelExitDeleteThread();
void sceKernelTerminateDeleteThread();
void sceKernelChangeCurrentThreadAttr();
void sceKernelChangeThreadPriority();
void sceKernelRotateThreadReadyQueue();
void sceKernelGetThreadId();
void sceKernelGetThreadCurrentPriority();
void sceKernelCheckThreadStack();
void sceKernelReferThreadStatus();

LIB_START(ThreadManForUser)
LIB_ADDFUNC(0x6e9ea350, _sceKernelReturnFromCallback)
LIB_ADDFUNC(0xe81caf8f, sceKernelCreateCallback)
LIB_ADDFUNC(0xedba5844, sceKernelDeleteCallback)
LIB_ADDFUNC(0xc11ba8c4, sceKernelNotifyCallback)
LIB_ADDFUNC(0x349d6d6c, sceKernelCheckCallback)

LIB_ADDFUNC(0xb7d098c6, sceKernelCreateMutex)
LIB_ADDFUNC(0xf8170fbe, sceKernelDeleteMutex)
LIB_ADDFUNC(0xb011b11f, sceKernelLockMutex)
LIB_ADDFUNC(0x5bf4dd27, sceKernelLockMutexCB)
LIB_ADDFUNC(0x6b30100f, sceKernelUnlockMutex)

LIB_ADDFUNC(0x19cff145, sceKernelCreateLwMutex)
LIB_ADDFUNC(0x60107536, sceKernelDeleteLwMutex)

LIB_ADDFUNC(0x9ace131e, sceKernelSleepThread)
LIB_ADDFUNC(0x82826f70, sceKernelSleepThreadCB)
LIB_ADDFUNC(0xd59ead2f, sceKernelWakeupThread)
LIB_ADDFUNC(0x9944f31f, sceKernelSuspendThread)
LIB_ADDFUNC(0x75156e8f, sceKernelResumeThread)
LIB_ADDFUNC(0x278c0df5, sceKernelWaitThreadEnd)
LIB_ADDFUNC(0xceadeb47, sceKernelDelayThread)
LIB_ADDFUNC(0x68da9e36, sceKernelDelayThreadCB)

LIB_ADDFUNC(0xd6da4ba1, sceKernelCreateSema)
LIB_ADDFUNC(0x28b6489c, sceKernelDeleteSema)
LIB_ADDFUNC(0x3f53e640, sceKernelSignalSema)
LIB_ADDFUNC(0x4e3a1105, sceKernelWaitSema)
LIB_ADDFUNC(0x6d212bac, sceKernelWaitSemaCB)
LIB_ADDFUNC(0x58b1f937, sceKernelPollSema)
LIB_ADDFUNC(0x8ffdf9a2, sceKernelCancelSema)
LIB_ADDFUNC(0xbc6febc5, sceKernelReferSemaStatus)

LIB_ADDFUNC(0x55c20a00, sceKernelCreateEventFlag)
LIB_ADDFUNC(0xef9e4c70, sceKernelDeleteEventFlag)
LIB_ADDFUNC(0x1fb15a32, sceKernelSetEventFlag)
LIB_ADDFUNC(0x812346e4, sceKernelClearEventFlag)
LIB_ADDFUNC(0x402fcf22, sceKernelWaitEventFlag)
LIB_ADDFUNC(0x328c546a, sceKernelWaitEventFlagCB)
LIB_ADDFUNC(0x30fd48f0, sceKernelPollEventFlag)
LIB_ADDFUNC(0xcd203292, sceKernelCancelEventFlag)
LIB_ADDFUNC(0xa66b0120, sceKernelReferEventFlagStatus)

LIB_ADDFUNC(0x56c039b5, sceKernelCreateVpl)
LIB_ADDFUNC(0x89b3d48c, sceKernelDeleteVpl)
LIB_ADDFUNC(0xbed27435, sceKernelAllocateVpl)
LIB_ADDFUNC(0xec0a693f, sceKernelAllocateVplCB)
LIB_ADDFUNC(0xaf36d708, sceKernelTryAllocateVpl)
LIB_ADDFUNC(0xb736e9ff, sceKernelFreeVpl)
LIB_ADDFUNC(0x1d371b8a, sceKernelCancelVpl)
LIB_ADDFUNC(0x39810265, sceKernelReferVplStatus)

LIB_ADDFUNC(0xc07bb470, sceKernelCreateFpl)
LIB_ADDFUNC(0xed1410e0, sceKernelDeleteFpl)
LIB_ADDFUNC(0xd979e9bf, sceKernelAllocateFpl)
LIB_ADDFUNC(0xe7282cb6, sceKernelAllocateFplCB)
LIB_ADDFUNC(0x623ae665, sceKernelTryAllocateFpl)
LIB_ADDFUNC(0xf6414a71, sceKernelFreeFpl)
LIB_ADDFUNC(0xa8aa591f, sceKernelCancelFpl)
LIB_ADDFUNC(0xd8199e4c, sceKernelReferFplStatus)

LIB_ADDFUNC(0x0e927aed, _sceKernelReturnFromTimerHandler)
LIB_ADDFUNC(0x110dec9a, sceKernelUSec2SysClock)
LIB_ADDFUNC(0xc8cd158c, sceKernelUSec2SysClockWide)
LIB_ADDFUNC(0xba6b92e2, sceKernelSysClock2USec)
LIB_ADDFUNC(0xe1619d7c, sceKernelSysClock2USecWide)
LIB_ADDFUNC(0xdb738f35, sceKernelGetSystemTime)
LIB_ADDFUNC(0x82bc5777, sceKernelGetSystemTimeWide)
LIB_ADDFUNC(0x369ed59d, sceKernelGetSystemTimeLow)
   
LIB_ADDFUNC(0x20fff560, sceKernelCreateVTimer)
LIB_ADDFUNC(0xc68d9437, sceKernelStartVTimer)
LIB_ADDFUNC(0xd8b299ae, sceKernelSetVTimerHandler)

LIB_ADDFUNC(0x3b183e26, sceKernelGetThreadExitStatus)
LIB_ADDFUNC(0x446d8de6, sceKernelCreateThread)
LIB_ADDFUNC(0x9fa03cd3, sceKernelDeleteThread)
LIB_ADDFUNC(0xf475845d, sceKernelStartThread)
LIB_ADDFUNC(0x532a522e, _sceKernelExitThread)
LIB_ADDFUNC(0xaa73c935, sceKernelExitThread)
LIB_ADDFUNC(0x809ce29b, sceKernelExitDeleteThread)
LIB_ADDFUNC(0x383f7bcc, sceKernelTerminateDeleteThread)
LIB_ADDFUNC(0xea748e31, sceKernelChangeCurrentThreadAttr)
LIB_ADDFUNC(0x71bc9871, sceKernelChangeThreadPriority)
LIB_ADDFUNC(0x912354a7, sceKernelRotateThreadReadyQueue)
LIB_ADDFUNC(0x293b45b8, sceKernelGetThreadId)
LIB_ADDFUNC(0x94aa61ee, sceKernelGetThreadCurrentPriority)
LIB_ADDFUNC(0xd13bde95, sceKernelCheckThreadStack)
LIB_ADDFUNC(0x17c1684e, sceKernelReferThreadStatus)
LIB_END

#endif

